<?php
require_once("init.php");
@$uname=$_REQUEST["uname"];
 if($uname===null || $uname===""){
     	die('用户名不能为空');
     }
$sql="SELECT uid FROM user WHERE uname='$uname'";
$result=mysqli_query($conn,$sql);
$row=mysqli_fetch_row($result);
if($row!=null){
    echo '{"code":-1,"msg":"用户名已经存在"}';
}else{
   echo '{"code":1,"msg":"用户名可以使用"}';
}
